
$(function(){

	$("#form-login").validate({
		rules: {
			username: {
				required: true
			},
			password: {
				required: true
			}
		},
		messages: {
			username: {
				required: "请输入用户名"
			},
			password: {
				required: "请输入密码"
			}
		},
		
		
		submitHandler: function(form){
			
			var eSubmit = document.getElementById("submit");
			eSubmit.disabled = true;
		
			$(".message-error").hide();
			$("#login-msg").removeClass().html(g_sLoadingImage + "登陆中...");
			
			$.ajax({
				type: "POST",
				url: "./?action=user.access.ajax_login_check",
				data: $(form).serialize(),
				dataType: "json",
				success: function(json){
					alert("aaaaaaa");
					eSubmit.disabled = false;
					
					if(json.status=="0")
					{
						$("#login-msg").html( json.description );
						window.location.href="./";
					}
					else
					{
						$("#login-msg").attr("class", "message-error").html( json.description );
					}
				}
			});	

		}
	});
});

